<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    .box {
      /* width: 500px; */
      height: 500px;
      background-color: #f00;
      transition: all 0.9s;
    }
    .active {
      width: 900px;
      height: 900px;
      background-color: #0f0;
    }
    /* 有.boxclass但是没有.active时执行 */
    .box:not(.active) {
      width: 500px;
    }
  </style>
  <body>
    <div id="app">
      <button @click="bol=!bol">点我</button>
      <div class="box" :class="{active:bol}"></div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          bol: true,
        },
      });
    </script>
  </body>
</html>
